# -*- encoding:utf-8 -*-
# @Time: 2022/11/12 1:58
# @Author: qiujixian
# @Email: 1253598817@qq.com
# @File: urls.py
# @Software: PyCharm
from .views import StudentViewSet, ClassesViewSet
from django.urls import path
from rest_framework.routers import DefaultRouter, SimpleRouter
urlpatterns = [

    # path('students/', StudentViewSet.as_view({'get': 'list', 'post': 'create'})),
    # path('students/<pk>/', StudentViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'}))
]
router = DefaultRouter()  # 创建路由器
router.register('students', StudentViewSet)  # 注册路由器
router.register('classes', ClassesViewSet)  # 注册路由器
urlpatterns += router.urls

